package popcorn.ticket.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import popcorn.ticket.entity.Collections;
import popcorn.ticket.entity.Orders;
import popcorn.ticket.entity.Ticket;
import popcorn.ticket.service.WelComeService;
import popcorn.ticket.tool.TableList;

@Controller
public class WelComeController {
	@Autowired
	private WelComeService ws;

	// 获取收入图表
	@GetMapping(value = "getodlist", produces = "application/json;charset=utf-8")
	@ResponseBody
	public TableList<Orders> sltODList() {
		return ws.getPriceList();
	}

	// 获取观影人数
	@GetMapping(value = "gettklist", produces = "application/json;charset=utf-8")
	@ResponseBody
	public TableList<Orders> sltTKList() {
		return ws.getNumList();
	}

	// 获取收藏人数
	@GetMapping(value = "getctlist", produces = "application/json;charset=utf-8")
	@ResponseBody
	public TableList<Collections> sltCTList() {
		return ws.getCollNumList();
	}

	// 获取用户人数
	@GetMapping(value = "getUserNum", produces = "application/json;charset=utf-8")
	@ResponseBody
	public int sltUSList() {
		return ws.getUserNum();
	}

	// 获取在映影厅数
	@GetMapping(value = "getHallsNum", produces = "application/json;charset=utf-8")
	@ResponseBody
	public int sltMHList() {
		return ws.getHallsNum();
	}

	// 查询在映片数
	@GetMapping(value = "getMoviesNum", produces = "application/json;charset=utf-8")
	@ResponseBody
	public int sltMVList() {
		return ws.getMoviesNum();
	}

	// 查询今日观影数
	@GetMapping(value = "getWatchNum", produces = "application/json;charset=utf-8")
	@ResponseBody
	public Ticket sltWMList() {
		return ws.getWatchNowNum();
	}

	// 查询今日赚到的钱
	@GetMapping(value = "getManeyNowNum", produces = "application/json;charset=utf-8")
	@ResponseBody
	public Orders sltManeyNowNum() {
		return ws.getManeyNowNum();
	}

}
